require('module-alias/register')
var passport = require('passport');
var qqStrategy = require('passport-qq').Strategy;
var { redisClient, setValue, getValue } = require('@utils/Redis')

var config = require('@root/config.js')

passport.use(new qqStrategy({
  clientID: config.authQQAppId,
  clientSecret: config.authQQAppKey,
  callbackURL: "http://127.0.0.1:3000/auth/qq/callback"
},
  function (accessToken, refreshToken, profile, done) {
    console.log(accessToken)
    console.log(refreshToken)
    console.log(profile)
    console.log(done)
  }
));

var authenticateQQ = passport.authenticate('qq')
function authenticateQQCallback(req, res, next) {
  console.log(req)
  console.log(res)
  console.log(next)
}
module.exports = { authenticateQQ, authenticateQQCallback, passport };
